import { getToken } from '@/utils';

// const initialState = '';
// 数据初始化
const initialState = getToken();
export const login = (state = initialState, action) => {
  if (action.type === 'login/token') {
    return action.payload
  }
  if (action.type === 'login/logout') {
    return ''
  }
  return state
}